package com.zking.ssm.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;

@Controller
@RequestMapping("/file")
public class FileController {

    @RequestMapping("/toUpload")
    public String toUpload(){
        return "upload";
    }

    @RequestMapping("/upload")
    public String upload(MultipartFile img){
        //1.将文件信息写入数据库
        System.out.println(img.getOriginalFilename());
        System.out.println(img.getContentType());

        return "index";
    }

}
